package com.shhm.common.context;

import com.shhm.common.entity.admin.SysRoleOperatePerms;

/**
 * @author JackZ
 * @version 1.0
 * @description: TODO
 * @date 2025/9/14 下午12:48
 */
public class PermsContextHolder {
    private static final ThreadLocal<SysRoleOperatePerms> PERMS_CONTEXT = new ThreadLocal<>();

    public static void setPermissions(SysRoleOperatePerms perms) {
        PERMS_CONTEXT.set(perms);
    }

    public static SysRoleOperatePerms getPermissions() {
        return PERMS_CONTEXT.get();
    }

    public static void clear() {
        PERMS_CONTEXT.remove();
    }
}
